home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NBC Slam Jams!
/
NBC Slam Jams!.iso
/
xtras
/
media_la
/
set_fx.dir
/
00024_Script_Tracking Object
< prev
next >
Wrap
Text File
|
1998-01-20
|
12KB
|
410 lines
-- This is the main object that contains general information about the selected member
-- Interface Elements (start with "ie")
property ieUpdateButton, ieFXtextlist
-- User selection properties
property pSelectedList -- list of all selected members in active cast
property pSelected -- the first or only selection
property pSelectedMember, pSelectedCast -- member name and cast name of selection
property pOriginalEffects, pNewEffects -- Alphamania effect arguments
property pDrawMethod, pOriginalDrawMethod -- The alphamania property of that member
-- Source member properties
property pSource, pSourceMember, pSourceCast, pSourcePosition
property pOriginalSource, pOriginalSourcePosition
property pAlphaOnly, pRelToSprite, pOriginalRelToSprite
-- Universal properties
property pEffectsList, pAllEffectsList
-- Misc properties
property pUpdateStage, void
on new me
global fxDisplayMember
set pSelected = VOID
set pSource = VOID
set pAllEffectsList = GetListOfAllEffects(fxDisplayMember)
if getPos(pAllEffectsList,#nullfx) then deleteAt(pAllEffectsList,getPos(pAllEffectsList,#nullfx))
getMemberNameAndCast(me)
if count(pSelectedList) > 1 then
alert "You have selected more than one AlphaMania member. Changes will affect all members, replacing any previous settings."
end if
getMemberEffects(me)
if validMember(me) then
getSourceNameAndCast(me)
end if
updateFXtextlist(me)
-- Update Stage CheckBox
set pUpdateStage = not voidP(pSelected)
set ieUpdateButton = new(script "CheckBox Button", [#sprite: 7, #cur: pUpdateStage, #active: TRUE, #callback: me])
return(me)
end
on removeFromList me
global fxCurObj, fxDisplayMember
if not objectP(ieFXtextlist) then exit
put the pCurActive of ieFXtextlist into i
if i < 1 or i > count(the pElementList of ieFXtextlist) then exit
set SelectedEffect = getAt(the pElementList of ieFXtextlist, i)
if findPos(GetEffectList(fxDisplayMember,SelectedEffect),SelectedEffect) > 0 then
RemoveEffect(fxDisplayMember,SelectedEffect)
clearTests(me)
end if
if not voidP(getAProp(pNewEffects,SelectedEffect)) then deleteProp(pNewEffects,SelectedEffect)
updateFXtextlist(me)
if objectP(fxCurObj) then
if the pEffect of fxCurObj = SelectedEffect then
Settings
end if
end if
end
on updateFXtextlist me ,newObj
put [] into list
if listp(pNewEffects) then
repeat with i = 1 to count(pNewEffects)
add list, getPropAt(pNewEffects,i)
end repeat
end if
if objectP(newObj) then set cur = the pEffect of newObj
else set cur = VOID
set ieFXtextlist = new(script "Text List", [#list: list, #textField: "FXlist", #textSprite: 10, #cur: cur])
end
on getFXList me
if voidP(pSelected) then
set pEffectsList = []
exit
end if
tell the stage to preLoad member pSelected
tell the stage to set pEffectsList = getEffectList(pSelected)
repeat with i = count(pEffectsList) down to 1
if getAt(pEffectsList,i) = #nullfx then deleteAt(pEffectsList,i)
end repeat
end
on goToEffect me, effect
global fxDisplayMember
put GetFXMovie(fxDisplayMember, effect) into mov
put GetFXPage(fxDisplayMember, effect) into page
releasePuppets(8,48)
resetDisplay
put 0 into i
put the fileName of the activeWindow into pn
if the platform contains "Mac" then set the itemDelimiter = ":"
else set the itemDelimiter = "\"
set pn = item 1 to (the number of items of pn - 1) of pn
repeat while TRUE
put i+1 into i
set file = getNthFileNameinFolder(pn, i)
if file = "" then
alert mov&&"not found."
exit
end if
if file = mov then exit repeat
if file = (mov&".dir") then exit repeat
if file contains mov then
set mov = file
exit repeat
end if
end repeat
go to frame page of movie mov
put "" into text
if the number of member (string(effect)&&"Help Text") > 0 then
put field (string(effect)&&"Help Text") after text
end if
set fxDisplayMember = the member of sprite 23
preload fxDisplayMember
put DescribeEffect(fxDisplayMember, effect) after text
put text into field "Help Text"
refresh(ieUpdateButton)
end
on getAllSelectedMembers me
set pSelecteList = []
tell the stage
if the activeCastLib > 10000 then return []
set pSelectedCast = the name of castLib the activeCastLib
set selectedMemberList = the selection of castLib the activeCastLib
repeat with x = 1 to count(selectedMemberList)
set smallList = getAt(selectedMemberList, x)
repeat with y = getAt(smallList, 1) to getAt(smallList, 2)
if the type of member y of castLib pSelectedCast = #alpha then
set pSelectedMember = the name of member y of castLib pSelectedCast
set pSelected = (member y of castLib pSelectedCast)
return pSelected
end if
end repeat
end repeat
end tell
return VOID
end
on getMemberNameAndCast me
set pSelectedList = [] -- list of all selections
set pSelected = VOID -- the first (or only) selection
set pSelectedMember = ""
set pSelectedCast = ""
tell the stage
if the activeCastLib > 10000 then exit
set pSelectedCast = the name of castLib the activeCastLib
set selectedMemberList = the selection of castLib the activeCastLib
repeat with x = 1 to count(selectedMemberList)
set smallList = getAt(selectedMemberList, x)
repeat with y = getAt(smallList, 1) to getAt(smallList, 2)
if the type of member y of castLib pSelectedCast = #alpha then
add pSelectedList, (member y of castLib pSelectedCast)
if voidP(pSelected) then -- if the first selected member
set pSelectedMember = the name of member y of castLib pSelectedCast
set pSelected = (member y of castLib pSelectedCast)
end if
end if
end repeat
end repeat
end tell
end
on getMemberEffects me
if voidP(pSelected) then
set list = [:]
else
tell the stage
preload member pSelected
put GetEffectList(pSelected) into list
repeat with i = 1 to count(list)
put getPropAt(list,i) into effect
put GetEffectArgs(pSelected,effect) into effectlist
setAt(list,i,effectlist)
end repeat
end tell
if findPos(list,#nullfx) then deleteAt(list,findPos(list,#nullfx))
end if
set pOriginalEffects = list
set pNewEffects = list
if not voidP(pSelected) then
tell the stage
set pDrawMethod = the drawMethod of pSelected
set pOriginalDrawMethod = the drawMethod of pSelected
end tell
end if
end
on setDrawMethod me, method
set pDrawMethod = method
if not voidP(pSelected) then
tell the stage to set the drawMethod of pSelected = pDrawMethod
end if
end
on setRelToSprite me, active
set pRelToSprite = active
if not voidP(pSelected) then
tell the stage to set the sourceRelToSprite of pSelected = pRelToSprite
end if
end
on resetProperties me
if not voidP(pSelected) then
tell the stage
set the drawMethod of pSelected = pOriginalDrawMethod
set the sourceRelToSprite of pSelected = pOriginalRelToSprite
if pOriginalSource <> 0 then set the sourceMember of pSelected = pOriginalSource
set the sourcePosition of pSelected = pOriginalSourcePosition
end tell
end if
end
on setMemberEffects me
if count(pSelectedList) < 1 then exit
clearTests(me)
tell the stage
repeat with m in pSelectedList
RemoveAllEffects(m)
repeat with i = 1 to count(pNewEffects)
put getPropAt(pNewEffects,i) into effect
put getAt(pNewEffects,i) into args
AddEffect(m,effect,args)
end repeat
end repeat
end tell
end
on testStageMember me, obj
if not pUpdateStage then exit
if voidP(pSelected) then exit
tell the stage
TestEffect(pSelected, the pEffect of obj, makePropertyList(obj))
end tell
end
on tempStageMember me, obj, effect, args
setAProp(pNewEffects, effect, makePropertyList(obj))
if not pUpdateStage then exit
if voidP(pSelected) then exit
tell the stage
TestEffect(pSelected, effect, args)
updateStage
end tell
end
on updateEffects me, obj
--testStageMember(me,obj)
setAProp(pNewEffects, the pEffect of obj, makePropertyList(obj))
end
on lingoToClipboard me, obj
put string(the pEffect of obj) into effect
put effect&"( sprite yourSprite,"&&makePropertyList(obj)&&")" into text
put text
put text into field "Lingo To Clipboard"
copyToClipboard member "Lingo To Clipboard"
end
on clearTests me
if voidP(pSelected) then exit
tell the stage to EndAllTests(pSelected)
end
on getSourceNameAndCast me
tell the stage
set pSource = the sourceMember of pSelected
set pOriginalSource = the sourceMember of pSelected
set pSourcePosition = the sourcePosition of pSelected
set pOriginalSourcePosition = the sourcePosition of pSelected
set pAlphaOnly = the alphaOnly of pSelected
set pRelToSprite = the sourceRelToSprite of pSelected
set pOriginalRelToSprite = the sourceRelToSprite of pSelected
if voidP(pSource) or pSource = 0 then
set pSource = VOID
set pSourceMember = ""
set pSourceCast = ""
else
set pSourceMember = the name of pSource
set pSourceCast = the name of castLib the castLibNum of pSource
end if
end tell
end
on validMember me
return not voidP(pSelected)
end
on setSourceMember me, pSource0
if voidP(pSource0) then exit
set pSource = pSource0
if not voidP(pSelected) then
tell the stage
set pSourceMember = the name of pSource
set pSourceCast = the name of castLib the castLibNum of pSource
set the sourceMember of member pSelected = pSource
end tell
end if
end
on newSourcePosition me, pos
set pSourcePosition = pos
if not voidP(pSelected) then
tell the stage
set the sourcePosition of pSelected = pos
end tell
end if
end
on setSourceCast me, pSourceCast0
set pSourceCast = pSourceCast0
set pSource = VOID
set pSouceMember = ""
tell the stage
repeat with c = 1 to the number of members of castLib pSourceCast
if the type of member c of castLib pSourceCast = #bitmap then
set pSource = member c of castLib pSourceCast
set pSourceMember = the name of pSource
set the sourceMember of member pSelected = pSource
exit
end if
end repeat
end tell
end
-- CALLBACKS
on CheckBox me, refCon, status
set pUpdateStage = status
end
-- Add Effect
on popupAddEffect me, sNum
global fxDisplayMember, fxWindow
set where = point(the right of sprite sNum, the top of sprite sNum)
set choice = PopUpMenu(fxDisplayMember, where, pAllEffectsList)
if (choice > 0) then
put GetAt(pAllEffectsList, choice) into effect
goToEffect(me,effect)
end if
end
on setMemory me, n
put [#effects: pNewEffects] into fx
addProp fx, #drawMethod, pDrawMethod
addProp fx, #sourceMember, pSource
addProp fx, #sourcePosition, pSourcePosition
set text = GetPref("AlphaMania FX Memory")
if voidP(text) then put "" into text
put string(fx) into line n of text
SetPref("AlphaMania FX Memory",text)
beep(1)
end
on getMemory me, n
set text = GetPref("AlphaMania FX Memory")
if voidP(text) then put "" into text
put value(line n of text) into fx
if listP(fx) then
if count(fx) > 3 then
setDrawMethod(me,getProp(fx,#drawMethod))
setSourceMember(me,getProp(fx,#sourceMember))
newSourcePosition(me,getProp(fx,#sourcePosition))
set pNewEffects = getProp(fx,#effects)
updateFXtextlist(me)
go to frame "General Member Settings"
beep(2)
end if
end if
end
on Release
set released = true
end